package com.aabte.springcloudlearn.ribbonhystrixcustomerdemo.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author Daniel
 */
@Configuration
public class MainConfig {

    /**
     * 通过{@link LoadBalanced}注解开启负载均衡
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
